package com.oa.ylms.apps.business.goods;

import java.util.List;

import com.oa.ylms.apps.entity.archives.StaffInfoValue;
import com.oa.ylms.apps.entity.goods.GoodOrderDetailValue;
import com.oa.ylms.apps.entity.goods.GoodOrderValue;

public interface IGoodsOrderService {
	public int getTotalNumber();
	/**
	 * 申请物资
	 * 
	 * @param returnTime
	 * @param detailList
	 * @throws Exception
	 */
	public void applyGoods(StaffInfoValue staffInfo,
			List<GoodOrderDetailValue> detailList) throws Exception;

	/**
	 * 查询个人的物资流通单(可根据状态:/全部/正在审批/审批通过/审批失败)
	 * 当正处于正在审批状态时，状态号就等于当前的审批流程到达的部门号。
	 * @param orderState
	 * @return
	 * @throws Exception
	 */
	public List<GoodOrderValue> queryPersonalOrder(StaffInfoValue staffInfo,int orderState,int rows,int pageNo)
			throws Exception;
	public int countTpages(StaffInfoValue staffInfo,
			int orderState,int rows)throws Exception;
	/**
	 * 审批人员权限：查询所有需要审批的物资流通单
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<GoodOrderValue> queryCheckOrder(StaffInfoValue staffInfo,int rows,int pageNo) throws Exception;

	/**
	 * 根据状态查询审批人员审批过的物资流通单
	 * 
	 * @param orderState
	 * @return
	 * @throws Exception
	 */
	public List<GoodOrderValue> queryCheckOrderByState(StaffInfoValue staffInfo,int orderState,int rows,int pageNo)
			throws Exception;

	/**
	 * 根据流通单的ID查询流通单上的详细物资申请的列表
	 * 
	 * @param orderId
	 * @return
	 * @throws Exception
	 */
	public List<GoodOrderDetailValue> queryDetailByOrderId(int orderId)
			throws Exception;

	/**
	 * 根据ID查询物资流通单
	 * 
	 * @param orderId
	 * @return
	 * @throws Exception
	 */
	public GoodOrderValue queryById(int orderId) throws Exception;

	/**
	 * 审批人员签署审核单：同意
	 * 
	 * @param orderId
	 * @param comments
	 * @throws Exception
	 */
	public void checkPass(StaffInfoValue staffInfo,int orderId, String comments) throws Exception;

	/**
	 * 审批人员签署审核单：不同意
	 * 
	 * @param orderId
	 * @param comments
	 * @throws Exception
	 */
	public void checkUnpass(StaffInfoValue staffInfo,int orderId, String comments) throws Exception;

	/**
	 * 归还物资
	 * 
	 * @param detailList
	 * @throws Exception
	 */
	public void backGoods(List<GoodOrderDetailValue> detailList)
			throws Exception;

	public List<GoodOrderValue> queryReturnOrder();


}
